[[ package gen;

import se.rupy.http.*;
import se.rupy.sprout.*;

public class login extends Sprout {
	public int index() { return 2; }
	public String path() { return "/login"; }
	public void filter(Event event) throws Event, Exception {
		Output out = event.output(); ]]

    <script>
    function remind() {
      if(document.getElementById('mail').value != '') {
        //alert(document.getElementById('mail').value);
        document.getElementById('login').action = 'remind';
        document.getElementById('login').submit();
      }
      return false;
    }
    </script>
    <form id="login" name="login" action="login" method="post">
      <table border="0" width="100">
        <tr>
          <td colspan="2">
            <div id="error">

[[		if(event.string("error").length() > 0) { ]]

              <font color="red"><i>[[ event.string("error") ]]</i></font>

[[		} ]]

            </div>
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <input id="mail" type="text" class="small" name="mail" value="[[ event.string("mail") ]]" tabindex="1"/>
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <input id="pass" type="password" class="small" name="pass" value="[[ event.string("pass") ]]" onkeypress="return myLoginKeyPressed(event);" tabindex="2"/>
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <div id="remind" [[ event.string("remind").length() > 0 ? "" : "style=\"display: none\"" ]]>
              <a href="" onclick="return remind();">[[ i18n("Forgot password?") ]]</a>
            </div>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <input id="remember" type="checkbox" name="remember"[[ event.bit("remember") ? " CHECKED" : "" ]]/>
          </td>
          <td align="right">
            <a href="" class="arrow" onclick="if (typeof ajaxLogin == 'function') { ajaxLogin(); } else { document.login.submit(); } return false;">
              <span>[[ i18n("Login") ]]</span>
            </a>
          </td>
        </tr>
        <tr>
          <td align="right" colspan="2">
            <a href="/register" class="button">
              <span>[[ i18n("Register") ]]</span>
            </a>
          </td>
        </tr>
      </table>
    </form>

[[ } 
} ]]

